//accepted 
#include <cstdio>
int n, a, b, x, y, i;
bool read(){
	scanf("%d", &n);
	return n!=0;
}
void process(){
	scanf("%d%d", &a, &b);
	for(i=0;i<n;++i){
		scanf("%d%d", &x, &y);
		if(x<a){
			if(y<b)printf("SO\n");
			else if(y>b)printf("NO\n");
			else printf("divisa\n");
		}
		else if(x>a){
			if(y<b)printf("SE\n");
			else if(y>b)printf("NE\n");
			else printf("divisa\n");
		}
		else printf("divisa\n");
		
	}
}
int main(){
	//freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
	while(read())process();
	return 0;
}
